home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / 3DDEMO.ZIP / 3D / DOCS / SETPAL.TXT < prev   
Encoding:
Text File  |  1996-07-23  |  2.4 KB  |  69 lines

  1.  
  2.  Setpal.c Utility 
  3.  
  4.  This document attempts to explain the setpal utility program.
  5.  
  6.  Setpal is used at the command prompt to create a palette that can
  7.  be used by my demo/engine to show different effects. The various
  8.  command line options are as follows.
  9.  
  10.     setpal read
  11.     
  12.       This reads in and displays the colors of a palette 
  13. previously created by either <write>|<phong>.
  14.  
  15.     setpal write
  16.     
  17.       This creates a linear palette with the number of shades
  18. entered when prompted by the program. The palette is taken from a PCX file,
  19. the user enters.
  20.  
  21.     setpal phong
  22.     
  23.       This creates a palette based on the phong illumination
  24. model. Ambient+Diffuse+Specular to better enhance shadings. The user
  25. is asked to enter in the number of shades of each color and initial Ambient
  26. level. For instance you might not want the palette to start at the color
  27. black. If that is the case increase the Ambient level (from 0 ->200) 
  28. appropriately. Shinnyness can also be incorporated in your palette. The
  29. higher the number the more metallic the palette will be. I usually put
  30. 15 for Shinnyness. Finally the user is asked to enter the Specular constant.
  31. This makes the highlight bigger (ie. more white will be shown for the 
  32. hightlight.) I like putting the value 55 for this. This gives a nice (but
  33. not to big highlight).
  34.  
  35.     setpal transparency
  36.    
  37.       This produces a transparency lookup table with X number of levels.
  38. With my current algorithm this table with 10 levels of transparency from
  39. (opaque to 90% transparent) is trully HUGE. 640k and as such can only be
  40. used in a protected mode enviroment.
  41.  
  42.           
  43.     setpal haze
  44.     
  45.       This produces a table that can simulate haze. The user is prompted
  46. for the number of levels of haze and the color he wants to haze to (r,g,b).
  47.  
  48.     
  49.     setpal voxel
  50.     
  51.       Finally this produces a shadow table with entered shadow percentage
  52. (0-100%). That is used for my voxel engine. Shadowing is accomplised at its
  53. simplest form by using 0,1 as on/off. If shadow is on then find color that
  54. is closest to the shadow. For example. Using 256 colors the table will be
  55. like this.
  56.                On/Off
  57.             0   1
  58. colors    0
  59.           1
  60.       .
  61.       .
  62.     255
  63.     
  64.   If shadow is off, just use same color, else find shadow color. Once we
  65. have this and a shadow mask ( see shmaskl.pcx etc. ) from a pcx file we
  66. can find if shadow is on/off by indexing into shadow table.
  67.  
  68.         
  69.